package com.example.node;

import com.example.node.message.Request;
import com.example.node.message.Response;

import java.nio.ByteBuffer;
import java.util.List;

/*
 * @className: Node
 * @author: chentao
 * @date: 2025/10/25 下午5:15
 * @Version: 1.0
 * @description:
 */
public interface Node {

    public void start() throws Exception;

    public void stop() throws Exception;

    public void onNodeMessage(ByteBuffer byteBuffer);

    public Response handleRequest(Request request);

    public Response send(Request request) throws Exception;

    public List<Response> sendAll(Request request) throws Exception;

    public int getActiveSize();

    public List<String> getActiveKeys();
}
